Skip to content

fix: nil pointer dereference in deletion sequencing when a before-resource is not yet observed#140

Merged
bobh66 merged 2 commits intocrossplane-contrib:mainfrom
gabgaudreau:fix/nil-pointer-deletion-sequencing
May 6, 2026
Merged

fix: nil pointer dereference in deletion sequencing when a before-resource is not yet observed#140
bobh66 merged 2 commits intocrossplane-contrib:mainfrom
gabgaudreau:fix/nil-pointer-deletion-sequencing

Conversation

@gabgaudreau
Copy link
Copy Markdown
Contributor

@gabgaudreau gabgaudreau commented May 6, 2026

Description of your changes

When enableDeletionSequencing=true, the function panics if a "before" resource exists in desiredComposed but not yet in observedComposed. Skip usage generation for resources that haven't been observed yet, the next reconcile should pick them up.

The unit test added covers exactly the use-case I have that reproduced the issue. Running the test without the code change correctly reproduces the issue.

Fixes #139

I have:

@gabgaudreau gabgaudreau requested review from bobh66 and turkenh as code owners May 6, 2026 13:13
@gabgaudreau
Copy link
Copy Markdown
Contributor Author

First time contributor, feel free to guide me if I did something not according to expectations :)

…ource is not yet observed

when enableDeletionSequencing=true, the function panics when a before-resource exists in desired but not yet in observed

Signed-off-by: Gabriel Gaudreau <ggaudreau@genetec.com>
@gabgaudreau gabgaudreau force-pushed the fix/nil-pointer-deletion-sequencing branch from 5474780 to c9d8526 Compare May 6, 2026 13:21
Copy link
Copy Markdown
Collaborator

@bobh66 bobh66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@bobh66 bobh66 merged commit d866224 into crossplane-contrib:main May 6, 2026
6 checks passed
@gabgaudreau gabgaudreau deleted the fix/nil-pointer-deletion-sequencing branch May 6, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic: nil pointer dereference at fn.go:181 when enableDeletionSequencing=true and a "before" resource is missing from observedComposed

2 participants